<?php

  $__uri = parse_url($_SERVER["REQUEST_URI"]);
  $_SERVER["REQUEST_URI"] = $__uri["path"] . (isset($__uri["query"]) ? "?" . $__uri["query"] : "");

  error_reporting(E_ALL | E_STRICT);
  ini_set("display_errors", 1);

  define("DOCUMENT_ROOT", dirname(__FILE__));
  define("HOME_PATH", dirname(DOCUMENT_ROOT));

  set_include_path(implode(PATH_SEPARATOR, array(
    implode(DIRECTORY_SEPARATOR, array(DOCUMENT_ROOT, 'library')), 
    implode(DIRECTORY_SEPARATOR, array(HOME_PATH, 'library')), 
    get_include_path()
  )));

  require_once "Zend/Debug.php";
  require_once "JooS/Server.php";
  require_once "JooS/Server/Request/Http.php";

  require_once "JooS/File.php";
  JooS_File::setDebugMode(true);
  
  echo JooS_Server::handle(new JooS_Server_Request_Http());

?>